<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
	<style type="text/css">
		*{
			margin: 0;
			padding: 0;
		}
	</style>
</head>
<body>
	<script type="text/javascript">
		
		//浏览器窗口的宽度 
		console.log(window.innerWidth)
		//浏览器可见区域宽度
		console.log(document.documentElement.clientWidth)
		//body的宽度
		console.log(document.body.clientWidth)

		//兼容性写法
		//宽度
		let width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
		//高度
		let height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
	</script>
</body>
</html>